import cv2
import numpy as np

img1 =cv2.imread("9\\4.bmp")
img2 =cv2.imread("9\\5.bmp")

kernel1=np.ones((20,70),np.uint8)

erosion1=cv2.dilate(img1,kernel1)
erosion1=cv2.erode(erosion1,kernel1)            

erosion2=cv2.dilate(img2,kernel1)
erosion2=cv2.erode(erosion2,kernel1)

cv2.imshow("img1",img1)
cv2.imshow("erosion1",erosion1)
cv2.imshow("img2",img2)
cv2.imshow("erosion2",erosion2)
cv2.waitKey()
cv2.destroyAllWindows()